<!--{include manage_header}-->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
<script type="text/javascript">
window.x_init_hook_gm = function() {
	X.misc.setbaidumap = function(ll){
		X.get(WEB_ROOT+'/ajax/system.php?action=baidumap&ll='+ll);	
	};
	X.misc.setbaidumappoint = function(e){
		jQuery('#inputlonglat').val(e.point.lat+','+e.point.lng);	
	};
	X.misc.setbaidumapclick = function(e){
		jQuery('#inputlonglat').val(e.point.lat+','+e.point.lng);	
	};
};
</script>
<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="/manage/partner/index.php">商家管理</a></li>
    <li><a href="/manage/partner/create.php">新建商家</a></li>
	<li style="float:right;  font-size:22px; ">
	 <a href="javascript::" style="padding-right:30px;color:#3B95C8;">
    <!--{if $_SESSION['ali_token']}-->${mb_strimwidth($login_user['realname'],0,10)}<!--{else}-->${mb_strimwidth($login_user['username'],0,10)}<!--{/if}-->
	</a> </li>
    </ul>
</div>

<div id="bdw" class="bdw">

<div class="right_main">
<div id="bd" class="cf">
<div id="partner">
	<!--<div class="dashboard" id="dashboard">
		<ul>${mcurrent_partner('create')}</ul>
	</div>-->
	<div id="content" class="clear mainwide">
        <div class="clear box">
        
            <div class="box-content">
                <!--<div class="head" id="head"><h2>新建商家</h2></div>-->
                <div class="sect">
				
                    <form id="login-user-form" method="post" action="/manage/partner/create.php" enctype="multipart/form-data" class="validator">
						<div class="wholetip clear"><h3>1、登录信息</h3></div>
                        <div class="field">
                            <label>用户名</label>
                            <input type="text" size="30" name="username" id="partner-create-username" class="f-input f-hint" value="{$partner['username']}" require="true" datatype="require" />
                        </div>
                        <div class="field password">
                            <label>登录密码</label>
                            <input type="text" size="30" name="password" id="settings-password" class="f-input f-hint" require="true" datatype="require" />
                        </div>

						<div class="wholetip clear"><h3>2、标注信息</h3></div>
						<div class="field">
							<label>所属分类：</label>
							<select name="group_id" class="f-input f-hint" style="width:160px;">${Utility::Option(option_category('partner'), $partner['group_id'])}</select>
						</div>
                        
                        <div class="field">
						<label>所属商圈：</label>
						<!--{if is_manager(1)}-->
						<select name="city_id" id="city_id"  onchange="changeArea(this,this.value,'area')">
							<option value="">选择城市</option>
							<!--{loop $allcities $index $city}-->
							<option value="{$city['id']}"<!--{if $city['id']==$partner['city_id']}--> selected<!--{/if}-->>{$city['name']}</option>
							<!--{/loop}-->
						</select>
						<select name="area_id" id="area_id" datatype="require" onchange="changeArea(this,this.value,'circle')">
							<option value="">选择区域</option>
							${Utility::Option($areas, $partner['area_id'])}
						</select>
						<!--{else}-->
						<select name="city_id" id="city_id"  onchange="changeArea(this,this.value,'area')">
							<option value="">选择城市</option>
							<!--{loop $allcities $index $city}-->
							<!--{if $city['id']==$login_user['city_id'] }-->
							<option  value="{$city['id']}"<!--{if $city['id']==$team['city_id'] }--> selected<!--{/if}-->>{$city['name']}</option>
							<!--{/if}-->
							<!--{/loop}-->
						</select>
						<select name="area_id" id="area_id" datatype="require" onchange="changeArea(this,this.value,'circle')">
							<option value="">选择区域</option>
							${Utility::Option($areas, $partner['area_id'])}
						</select>
						<!--{/if}-->
						</div>
                        
                        
                        
                        <div class="field">
                            <label>排序字段</label>
                            <input type="text" size="10" name="head" value="${abs(intval($partner['head']))}" class="number"/><span class="inputtip">数字大的排的靠前</span>
						</div>
						<div class="field">
							<label>首页展示</label>
							<input type="text" size="30" name="display" id="partner-edit-display" class="number" value="{$partner['display']}" maxLength="1" require="true" datatype="english" style="text-transform:uppercase;" /><span class="inputtip">Y:首页商户展示 N:不参与首页商户展示</span>
						</div>
						<div class="field">
							<label>商户展示</label>
							<input type="text" size="30" name="open" id="partner-edit-open" class="number" value="{$partner['open']}" maxLength="1" require="true" datatype="english" style="text-transform:uppercase;" /><span class="inputtip">Y:前台商户展示 N:不参与前台商户展示</span>
						</div>
                                  	<div class="field">
						<label>品牌店</label>

								<input type="checkbox" class="allowrefund" name="brands" value="Y" <!--{if $partner['brands']=='Y'}-->checked<!--{/if}-->/>&nbsp;是&nbsp;&nbsp;					 
					  </div>
						<div class="field">
							<label>商家图片</label>
							<input type="file" size="30" name="upload_image" id="partner-create-image" class="f-input f-hint" />
							<!--<span class="hint">至少得上传一张商家图片</span>-->
						</div>
						<!--<div class="field">
							<label>商家图片1</label>
							<input type="file" size="30" name="upload_image1" id="partner-create-image1" class="f-input f-hint" />
						</div>
						<div class="field">
							<label>商家图片2</label>
							<input type="file" size="30" name="upload_image2" id="partner-create-image2" class="f-input f-hint" />
						</div>-->
                        <div class="field">
                            <label>地图坐标</label> 
                            <input type="text" size="30" name="longlat" style="width:300px;cursor:point;" class="f-input f-hint" id="inputlonglat"  value="{$partner['longlat']}"  /><span class="inputtip"><a href="http://api.map.baidu.com/lbsapi/getpoint/" style="cursor:point;" target="_blank">取地图坐标信息</a></span>
                            <!--<input type="text" size="30" name="longlat" style="width:300px;cursor:point;" class="f-input f-hint" id="inputlonglat" readonly value="{$partner['longlat']}" onclick="X.misc.setbaidumap('{$partner['longlat']}');" /><span class="inputtip"><a href="javascript:;" style="cursor:point;" onclick="jQuery('#inputlonglat').val('');">取消地图坐标信息</a></span>-->
						</div>
			
						<div class="wholetip clear"><h3>3、基本信息</h3></div>
                        <div class="field">
                            <label>商户名称</label>
                            <input type="text" size="30" name="title" id="partner-create-title" class="f-input f-hint" value="{$partner['title']}" require="true" datatype="require" />
                        </div>
                        <div class="field">
                            <label>网站地址</label>
                            <input type="text" size="30" name="homepage" id="partner-create-homepage" class="f-input f-hint" value="{$partner['homepage']}"/>
                        </div>
                        <div class="field">
                            <label>联系人</label>
                            <input type="text" size="30" name="contact" id="partner-create-contact" class="f-input f-hint" value="{$partner['contact']}" />
						</div>
                        <div class="field">
                            <label>联系电话</label>
                            <input type="text" size="30" name="phone" id="partner-create-phone" class="f-input f-hint" value="{$partner['phone']}" maxLength="18" datatype="require" require="ture" />
						</div>
                        <div class="field">
                            <label>商户地址</label>
                            <input type="text" size="30" name="address" id="partner-create-address" class="f-input f-hint" value="{$partner['address']}" datatype="require" require="true" />
						</div>
                        <div class="field">
                            <label>手机号码</label>
                            <input type="text" size="30" name="mobile" id="partner-create-mobile" class="f-input f-hint" value="{$partner['mobile']}" maxLength="11" />
						</div>
                         <div class="field">
                            <label>营业时间</label>
                            <input type="text" size="30" name="yy_time" id="partner-create-mobile" class="f-input f-hint" value="{$partner['yy_time']}" maxLength="11" />
						</div>
                
                        <div class="field">
                            <label>商家地图</label>
                            <div style="float:left;"><textarea cols="45" rows="5" name="location" id="forum-new-content2" style="width:710px;height:150px;" class="f-textarea editor">${htmlspecialchars($partner['location'])}</textarea></div>
						</div>
                        <div class="field">
                            <label>商家介绍</label>
                            <div style="float:left;"><textarea cols="45" rows="5" name="other"  style="width:710px;height:150px;" class="f-textarea editor">${htmlspecialchars($partner['other'])}</textarea></div>
						</div>
                        <!--<div class="field">
                            <label>店面服务</label>
                            <div style="float:left;"><textarea cols="45" rows="5" name="server" id="forum-new-content0" style="width:710px;height:150px;" class="f-textarea editor">{$partner['server']}</textarea></div>
						</div>-->
						
           
						<div class="wholetip clear"><h3>4、银行信息</h3></div>
                        <div class="field">
                            <label>开户行</label>
                            <input type="text" size="30" name="bank_name" id="partner-create-bankname" class="f-input f-hint" value="{$partner['bank_name']}"/>
                        </div>
                        <div class="field">
                            <label>开户名</label>
                            <input type="text" size="30" name="bank_user" id="partner-create-bankuser" class="f-input f-hint" value="{$partner['bank_user']}"/>
                        </div>
                        <div class="field">
                            <label>银行账户</label>
                            <input type="text" size="30" name="bank_no" id="partner-create-bankno" class="f-input f-hint" value="{$partner['bank_no']}"/>
                        </div>
						
			
						<!-- 商家自助插件 后台权限 -->
						<div class="wholetip clear"><h3>5、后台权限</h3></div>
						<div class="field">
							<label>发布团购</label>
							<input type="text" size="30" name="business_team_edit" id="partner-team-edit" class="number" value="{$partner['business_team_edit']}" maxLength="1" require="true" datatype="english" style="text-transform:uppercase;" /><span class="inputtip">Y:允许发布 N:不允许发布</span>
						</div>
						<div class="field">
							<label>管理订单</label>
							<input type="text" size="30" name="business_order_edit" id="partner-order-edit" class="number" value="{$partner['business_order_edit']}" maxLength="1" require="true" datatype="english" style="text-transform:uppercase;" /><span class="inputtip">Y:允许查看管理订单 N:不允许查看管理订单</span>
						</div>
			
                        <div class="act">
                            <input type="submit" value="新建" name="commit" id="partner-submit" class="formbutton"/>
                        </div>
						
                    </form>
                </div>
            </div>
        </div>
	</div>

<div id="sidebar">
</div>

</div>
</div> <!-- bd end -->
</div>
</div> <!-- bdw end -->

<!--{include manage_footer}-->

<script type="text/javascript">
function changeArea(self,fid,zone){
	$this=$(self);
	$.get("area.php",{
		'fid':fid,
		'zone':zone
		},function(data){
			$this.next().html(data);
			if(self.name=='city_id'){
				$this.next().next().html('<option value="">选择商圈</option>');
			}
		});
}

</script>